<?
//inculde即可以使用data数据。本页所有的data数据，倾在controller都处理好
include_once("../../../../../config.php");
include_once("/../../../../common/module/checkA.php");
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <?php include ROOT_PATH_.'/controller/common/module/head.php'; ?>
    <!-- 日期选择器 -->
    <?php include_once(TASK_PATH_.'/mod-date.php'); ?>
    <!--kindeditor编辑器-->
    <?php include_once(TASK_PATH_.'/mod-nkeditor.php'); ?>
</head>
<style>
    html{
        background: #fff;
    }
    #content{
        margin: 0;
    }
    .detail-box{
        
        margin: 0px 0 70px 0;
    }
    .detail-box .function{
        margin-left: 0;
    }
</style>
<body>
<div id="content">
    <?php $page_title='修改任务关联';?>
    <?php include ROOT_PATH_.'/controller/common/module/mod-page-title.php'; ?>
    <?php
    $info = select_one_line_all_items($table_Prefix."task_themes_list",' nid = '.$_REQUEST['nid']);
    ?>
    <form id="add-task-form" method="post"
          action="../task-themes-list-edit-function.php?sys_part=task"
          enctype="multipart/form-data" class="layui-form detail-box">

        <div class="layui-form-item">
            <label class="layui-form-label">子任务标题</label>
            <div class="layui-input-block">
                <input type="text" name="ai_name" lay-verify="required" placeholder="请输入子任务标题" autocomplete="off" class="layui-input" value="<?php echo $info['name']?>">
            </div>
        </div>

        <?
        $agean_list=select_lines_all_items($table_Prefix."task_themes_list","nid desc"," nid != ".$_REQUEST['nid'],"0");
        ?>
        <div class="layui-form-item">
            <label class="layui-form-label">选择关联上一级任务</label>
            <div class="layui-input-block">
                <select name="ai_pid" lay-search="">
                    <option value="0">选择关联上一级任务</option>
                    <? for($i=0;$i<count($agean_list);$i++){ ?>
                        <option value="<? echo $agean_list[$i]['nid'] ?>" <?php if($info['pid'] == $agean_list[$i]['nid'] ){ echo 'selected';} ?> ><? echo $agean_list[$i]['nid'] ?> : <? echo $agean_list[$i]['name'] ?></option>
                    <? } ?>
                </select>
            </div>
        </div>

        <?

        $principal_list=select_lines_all_items($table_Prefix."employee","nid desc","","0");

        $principal=select_one_line_all_items($table_Prefix."employee","nid = '".$info['principal']."'");
        ?>

        <div class="layui-form-item">
            <label class="layui-form-label">执行人</label>
            <div class="layui-input-block">
                <select name="ai_principal" lay-search="">
                    <option  value="无" > 无</option>
                    <? for($i=0;$i<count($principal_list);$i++){ ?>
                        <option value="<? echo $principal_list[$i]['nid'] ?>" <?php if($info['principal'] == $principal_list[$i]['nid']){echo "selected";} ?> ><? echo $principal_list[$i]['nid'] ?> : <? echo $principal_list[$i]['name'] ?></option>
                    <? } ?>
                </select>
            </div>
        </div>


        <!-- <div class="layui-form-item">
             <label class="layui-form-label">截止时间</label>
             <div class="layui-input-block">
                 <input type="text" name="ai_enddate" id="end_date" autocomplete="off" class="layui-input" class="laydate-icon" placeholder="请选择截止时间">
             </div>
         </div>
 -->
        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea id="ai_note" name="ai_note" cols="77"><?php echo $info['note'] ?></textarea>
            </div>
        </div>


        <div class="layui-form-item">
            <label class="layui-form-label">优先级</label>
            <div class="layui-input-block">
                <input type="radio" name="ai_priority" value="无" title="无"
                    <? if($info['priority']=="无"){echo "checked";} ?>
                >

                <input type="radio" name="ai_priority" value="普通" title="普通"
                    <? if($info['priority']=="普通"){echo "checked";} ?>
                >

                <input type="radio" name="ai_priority" value="紧急" title="紧急"
                    <? if($info['priority']=="紧急"){echo "checked";} ?>
                >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">

                <input type="radio" name="ai_status" value="未开始" title="未开始"
                    <? if($info['status']=="未开始"){echo "checked";} ?>
                >

                <input type="radio" name="ai_status" value="进行中" title="进行中"
                    <? if($info['status']=="进行中"){echo "checked";} ?>
                >

                <input type="radio" name="ai_status" value="待审核" title="待审核"
                    <? if($info['status']=='待审核'){echo "checked";} ?>
                >


                    <input type="radio" name="ai_status" value="已完成" title="已完成"
                        <? if($info['status']=="已完成"){echo "checked";} ?>
                    >

            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">任务重复</label>
            <div class="layui-input-block">
                <input type="radio" name="ai_circulate" value="不重复" title="不重复"
                    <? if(($info['circulate']=="不重复")or($task['circulate']=="")){echo "checked";} ?>
                >
                <input type="radio" name="ai_circulate" value="每天重复" title="每天重复"
                    <? if($info['circulate']=="每天重复"){echo "checked";} ?>
                >
                <input type="radio" name="ai_circulate" value="每周重复" title="每周重复"
                    <? if($info['circulate']=="每周重复"){echo "checked";} ?>
                >
                <input type="radio" name="ai_circulate" value="每月重复" title="每月重复"
                    <? if($info['circulate']=="每月重复"){echo "checked";} ?>
                >
                <input type="radio" name="ai_circulate" value="每年重复" title="每年重复"
                    <? if($info['circulate']=="每年重复"){echo "checked";} ?>
                >
                <div class="layui-col-md12">
                    <div class="notice">当任务状态被更改为已完成时，按任务的重复周期自动创建新任务，默认为不重复</div>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">选择任务日数</label>
            <div class="layui-input-block">
                <input type="text" name="ai_days" lay-verify="required" placeholder="请输入任务日数" autocomplete="off" class="layui-input" value="<?php echo $info['days']?>">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">排序</label>
            <div class="layui-input-block">
                <input type="text" name="ai_listorder"  placeholder="请输入排序" autocomplete="off" class="layui-input" value="<?php echo $info['listorder']?>">
            </div>
        </div>


        <input name="nid" type="hidden" value="<? echo $info['nid'] ?>"/>
        <input name="sys_part" type="hidden" value="<? echo $system_part ?>"/>
        <input name="nowpageid" type="hidden" value="<? echo $_REQUEST['nowpageid'] ?>"/>
        <input name="sortby" type="hidden" value="<? echo $_REQUEST['sortby'] ?>"/>
        <input name="ai_themes_id" type="hidden" value="<? echo $_REQUEST['themes_id'] ?>"/>

        <div class="function">
            <button class="layui-btn" lay-submit lay-filter="formTaskBtn" type="buttom" id="taskBtn">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </form>



</div>
</html>